#ifndef MyUart_H
#define MyUart_H

#include <QByteArray>

class MyUart
{
public:
    enum{ FAILED=-1,  SUCCESS=0 };
    MyUart();
    ~MyUart();
    int getFileDescriptor();
    int readRawData();
    int writeRawData(QByteArray &msg);

private:
    int initUart();
    int setSpeed(int fd, int speed);
    int openUart(const char * dev);
    int closeUart(int fd);
    int setparity(int fd, int databits, int stopbits, int parity);

private:
    int fd_uart;
};

#endif // MyUart_H
